import request from './request'

const userLogin = ({ userName, loginPwd, userType } = {}) =>
  request.post('/user/login', { userName, loginPwd, userType })

const userRegister = ({ userName, loginPwd } = {}) =>
  request({
    method: 'POST',
    url: '/user/register',
    data: { userName, loginPwd },
  })

const userForgetPwd = ({ userName, loginPwd } = {}) =>
  request.put('/user/forgetpwd', { userName, loginPwd })

const getUserProfile = () => request.get('/user/profile')

const userLogOut = () => request.get('/user/logout')

export { userLogin, userRegister, userForgetPwd, getUserProfile, userLogOut }
